home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-5471 / doc / encode.txt < prev    next >
Text File  |  1995-08-29  |  26KB  |  680 lines

  1.  
  2.                                  mpeg2encode
  3.                                  ===========
  4.  
  5.                    MPEG-2 Video Encoder, Version 1.1, June 1994
  6.  
  7.                         MPEG Software Simulation Group
  8.                              (MPEG-L@netcom.com)
  9.  
  10.  
  11. Contents:
  12. =========
  13.  
  14. 1. Overview
  15. 2. Features and Limitations
  16. 3. Usage
  17. 4. Interpreting the status information
  18. 5. Description of the Encoder Model
  19. 6. References
  20.  
  21.  
  22. 1. Overview
  23. ===========
  24.  
  25.   This is the second public release of our MPEG-2 encoder. It converts an
  26.   ordered set of uncompressed input pictures into a compressed bitstream
  27.   compliant with ISO/IEC 13818-2 DIS [1] (MPEG-2).
  28.  
  29.   This program will evolve to become: ISO/IEC 13818-5 Software Simulation
  30.   of MPEG-2 Systems, Video, and Audio.
  31.  
  32.  
  33. 2. Features and Limitations
  34. ===========================
  35.  
  36.  2.1 Features
  37.  
  38.   - generates constant bit rate streams
  39.   - encoder model based on MPEG-2 test model 5 (TM5) rev. 2 [2]
  40.   - progressive and interlaced video
  41.   - also generates ISO/IEC 11172-2 (MPEG-1) sequences
  42.   - input formats: separate YUV, combined YUV, PPM
  43.   - trace and statistics output
  44.   - verifies user parameter settings are legal within Profile and Level
  45.  
  46.  
  47.  2.2 Current limitations
  48.  
  49.   The encoder currently does not support
  50.  
  51.   - scalable extensions
  52.   - MPEG-1 integer pel vectors (half-pel is typically 1 dB better anyway) 
  53.     and D frame sequences.
  54.   - checking for maximum number of generated bits per macroblock
  55.   - automatic 3:2 pulldown detection or irregular 3:2 pulldown signaling.
  56.   - intra refresh slices (e.g. low delay)
  57.   - concealment motion vectors 
  58.   - special low delay mode rate control
  59.   - editing of encoded video 
  60.   - variable bit rate encoding
  61.   - scene change rate control
  62.  
  63. 3. Usage
  64. ========
  65.  
  66.   The execution template for the encoder is:
  67.  
  68.       mpeg2encode parameter_file output.m2v
  69.  
  70.   Coding parameters can be modified by editing the parameter_file. Since the
  71.   parser expects the operating parameters to be on certain line numbers, 
  72.   kindly do not insert or delete lines from the file.
  73.  
  74.   We have provided a couple of sample parameter files in the par directory.
  75.   It is recommended to use the one closest to your application as a starting
  76.   point for customization.
  77.  
  78.   The first line of the parameter file is a comment which is inserted near
  79.   the beginning of the MPEG bitstream as a user_data field, and can be 
  80.   used for arbitrary purposes.
  81.  
  82.   The remaining lines are described below:
  83.  
  84.  /* name of source frame files */
  85.  
  86.   A printf format string defining the name of the input files. It has to
  87.   contain exactly one numerical descriptor (%d, %x etc.):
  88.  
  89.   Example: frame%02d 
  90.   Then the encoder looks for files: frame00, frame01, frame02
  91.  
  92.   The encoder adds an extension (.yuv, .ppm, etc.) which depends on the 
  93.   input file format. Input files have to be in frame format, containing 
  94.   two interleaved fields (for interlaced video).
  95.  
  96.   -- Added --
  97.   The encoder supports multiple GIF[3] files (containing either one or
  98.   multiple images and conforming to either gif87a or gif89a format), or
  99.   a single GIF file containg multiple images. If the format string
  100.   contains a %, then multiple files are assumed, and only the first frame
  101.   within the files are used. Otherwise a single multiple imaged file is
  102.   assumed.
  103.  
  104.   Example: Images
  105.   The encoder then reads the frames from the file Images.gif
  106.  
  107.   Example: Images%d
  108.   The encoder looks for frames in files: Images0, images1, ...
  109.  
  110.   BUGS:-
  111.  
  112.   Does not create a default palette for cases where a global and local
  113.   palette does not exists.
  114.  
  115.  /* name of reconstructed frame files */
  116.  
  117.   This user parameter tells the encoder what name to give the reconstructed 
  118.   frames. These frames are identical to frame reconstructions of decoders 
  119.   following normative guidelines (except of course for differences caused by 
  120.   different IDCT implementation). Specifying a name starting with - (or just 
  121.   - by itself) disables output of reconstructed frames.
  122.  
  123.   The reconstructed frames are always stored in Y,U,V format (see below),
  124.   independent of the input file format.
  125.  
  126.  /* name of intra quant matrix file     ("-": default matrix) */ 
  127.  
  128.   Setting this to a value other than  -  specifies a file containing
  129.   a custom intra quantization matrix to be used instead of the default 
  130.   matrix specified in ISO/IEC 13818-2 and 11172-2. This file has to contain 
  131.   64 integer values (range 1...255) separated by white space (blank, tab, 
  132.   or newline), one corresponding  to each of the 64 DCT coefficients. They 
  133.   are ordered line by line, i.e. v-u frequency matrix order (not by the 
  134.   zig-zag pattern used for transmission). The file intra.mat contains the 
  135.   default matrix as a starting point for customization. It is neither 
  136.   necessary or recommended to specify the default matrix explicitly.
  137.  
  138.   Large values correspond to coarse quantization and consequently more
  139.   noise at that particular spatial frequency.
  140.  
  141.   For the intra quantization matrix, the first value in the file (DC value)
  142.   is ignored. Use the parameter intra_dc_precision (see below) to define
  143.   the quantization of the DC value.
  144.  
  145.  /* name of non intra quant matrix file ("-": default matrix) */
  146.  
  147.   This parameter field follows the same rules as described for the above 
  148.   intra quant matrix parameter, but specifies the file for the NON-INTRA 
  149.   coded (predicted / interpolated) blocks. In this case the first 
  150.   coefficient of the matrix is NOT ignored.    
  151.  
  152.   The default matrix uses a constant value of 16 for all 64 coefficients.
  153.   (a flat matrix is thought to statistically minimize mean square error). 
  154.   The file inter.mat contains an alternate matrix, used in the MPEG-2 test
  155.   model.
  156.  
  157.  /* name of statistics file */
  158.  
  159.   Statistics output is stored into the specified file. - directs statistics
  160.   output to stdout.
  161.  
  162.  /* input picture file format */ 
  163.  
  164.   A number defining the format of the source input frames.
  165.  
  166.   Code  Format description
  167.   ----  ------------------------------------------------------------------
  168.   0     separate files for luminance (.Y extension), and chrominance (.U, .V)
  169.         all files are in headerless 8 bit per pixel format. .U and .V must 
  170.         correspond to the selected chroma_format (4:2:0, 4:2:2, 4:4:4, see
  171.         below).  Note that in this document, Cb = U, and Cr = V. This format
  172.         is also used in the Stanford PVRG encoder.
  173.  
  174.   1     similar to 0, but concatenated into one file (extension .yuv).
  175.         This is the format used by the Berkeley MPEG-1 encoder.
  176.  
  177.   2     PPM, Portable PixMap, only the raw format (P6) is supported.
  178.  
  179.   -- Added --
  180.   3     GIF, supports both GIF87a, and GIF89a files. The encoder can support
  181.  multiple imaged GIF89a files.
  182.  
  183.  /* number of frames */
  184.  
  185.   This defines the length of the sequence in integer units of frames.
  186.  
  187.  /* number of first frame */
  188.  
  189.   Usually 0 or 1, but any other (positive) value is valid.
  190.  
  191.  /* timecode of first frame */
  192.  
  193.   This line is used to set the timecode encoded into the first 'Group of
  194.   Pictures' header. The format is based on the SMPTE style:
  195.  
  196.   hh:mm:ss:ff (hh=hour, mm=minute, ss=second, ff=frame (0..picture_rate-1)
  197.  
  198.  /* N (# of frames in GOP) */
  199.  
  200.   This defines the distance between I frames (and 'Group of Pictures'
  201.   headers). Common values are 15 for 30 Hz video and 12 for 25 Hz video.
  202.  
  203.  /* M (I/P frame distance) */
  204.  
  205.   Distance between consecutive I or P frames. Usually set to 3.
  206.   N has to be a multiple of M.   M = 1 means no B frames in the sequence.
  207.   (in a future edition of this program, M=0 will mean only I frames).
  208.  
  209.  /* ISO/IEC 11172-2 stream */
  210.  
  211.   Set to 1 if you want to generate an MPEG-1 sequence. In this case some
  212.   of the subsequent MPEG-2 specific values are ignored.
  213.  
  214.  /* picture format */
  215.  
  216.   0 selects frame picture coding, in which both fields of a frame are coded
  217.   simultaneously, 1 select field picture coding, where fields are coded
  218.   separately. The latter is permitted for interlaced video only.
  219.  
  220.  /* horizontal_size */
  221.  
  222.   Pixel width of the frames. It does not need to be a multiple of 16. 
  223.   You have to provide a correct value even for PPM files (the PPM 
  224.   file header is currently ignored).
  225.  
  226.  /* vertical_size */
  227.  
  228.   Pixel height of the frames. It does not need to be a multiple of 16. 
  229.   You have to provide a correct value even for PPM files (the PPM file 
  230.   header is currently ignored).
  231.  
  232.  /* aspect_ratio_information */
  233.  
  234.   Defines the display aspect ratio. Legal values are:
  235.  
  236.   Code    Meaning
  237.   ----    --------------
  238.   1       square pels
  239.   2       4:3 display
  240.   3       16:9 display
  241.   4       2.21:1 display
  242.  
  243.   MPEG-1 uses a different coding of aspect ratios. In this cases codes
  244.   1 to 14 are valid.
  245.  
  246.  /* frame_rate_code */
  247.  
  248.   Defines the frame rate (for interlaced sequences: field rate is twice 
  249.   the frame rate). Legal values are:
  250.  
  251.   Code  Frames/sec    Meaning
  252.   ----  ----------    -----------------------------------------------
  253.   1     24000/1001    23.976 fps -- NTSC encapsulated film rate 
  254.   2     24            Standard international cinema film rate
  255.   3     25            PAL (625/50) video frame rate
  256.   4     30000/1001    29.97 -- NTSC video frame rate 
  257.   5     30            NTSC drop-frame (525/60) video frame rate
  258.   6     50            double frame rate/progressive PAL 
  259.   7     60000/1001    double frame rate NTSC
  260.   8     60            double frame rate drop-frame NTSC
  261.  
  262.  /* bit_rate */
  263.  
  264.   A positive floating point value specifying the target bitrate.
  265.   In units of bits/sec.
  266.  
  267.  /* vbv_buffer_size (in multiples 16 kbit) */
  268.  
  269.   Specifies, according to the Video Buffering Verifier decoder model,  
  270.   the size of the bitstream input buffer required in downstream 
  271.   decoders in order for the sequence to be decoded without underflows or 
  272.   or overflows.  You probably will wish to leave this value at 112 for
  273.   MPEG-2 Main Profile at Main Level, and 20 for Constrained Parameters
  274.   Bitstreams MPEG-1.
  275.  
  276.  /* low_delay */
  277.  
  278.   When set to 1, this flag specifies whether encoder operates in low delay 
  279.   mode.  Essentially, no B pictures are coded and a different rate control 
  280.   strategy is adopted which allows picture skipping and VBV underflows.  
  281.   This feature has not yet been implemented. Please leave at zero for now.
  282.  
  283.  /* constrained_parameters_flag */
  284.  
  285.   Always 0 for MPEG-2. You may set this to 1 if you encode an MPEG-1 
  286.   sequence which meets the parameter limits defined in ISO/IEC 11172-2 
  287.   for constrained parameter bitstreams:
  288.  
  289.     horizontal_size <= 768
  290.     vertical_size   <= 576
  291.     picture_area    <= 396 macroblocks
  292.     pixel_rate      <= 396x25 macroblocks per second
  293.     vbv_buffer_size <= 20x16384 bit
  294.     bitrate         <= 1856000 bits/second
  295.     motion vector range <= -64...63.5
  296.  
  297.  /* Profile ID */
  298.  
  299.   Specifies the subset of the MPEG-2 syntax required for decoding the 
  300.   sequence. All MPEG-2 sequences generated by the current version of 
  301.   the encoder are either Main Profile or Simple Profile sequences.
  302.  
  303.   Code  Meaning                       Typical use
  304.   ----  --------------------------    ------------------------
  305.   1     High Profile                  production equipment requiring 4:2:2
  306.   2     Spatially Scalable Profile    Simulcasting 
  307.   3     SNR Scalable Profile          Simulcasting
  308.   4     Main Profile                  95 % of TVs, VCRs, cable applications
  309.   5     Simple Profile                Low cost memory, e.g. no B pictures
  310.  
  311.  /* Level ID */
  312.  
  313.   Specifies coded parameter constraints, such as bitrate, sample rate, and 
  314.   maximum allowed motion vector range.
  315.  
  316.   Code  Meaning         Typical use
  317.   ----  --------------- -----------------------------------------------
  318.   4     High Level      HDTV production rates: e.g. 1920 x 1080 x 30 Hz
  319.   6     High 1440 Level HDTV consumer rates: e.g. 1440 x 960 x 30 Hz
  320.   8     Main Level      CCIR 601 rates: e.g. 720 x 480 x 30 Hz
  321.   10    Low Level       SIF video rate: e.g. 352 x 240 x 30 Hz
  322.  
  323.  /* progressive_sequence */
  324.  
  325.   0 in the case of a sequences containing interlaced video (e.g. 
  326.   video camera source), 1 for progressive video (e.g. film source).
  327.  
  328.  /* chroma_format */
  329.  
  330.   Specifies the resolution of chrominance data
  331.   Code  Meaning
  332.   ----  ------- ----------------------------------------
  333.   1     4:2:0   half resolution in both dimensions (most common format)
  334.   2     4:2:2   half resolution in horizontal direction (High Profile only)
  335.   3     4:4:4   full resolution (not allowed in any currently defined profile)
  336.  
  337.  /* video_format: 0=comp., 1=PAL, 2=NTSC, 3=SECAM, 4=MAC, 5=unspec. */
  338.  
  339.  /* color_primaries */
  340.  
  341.   Specifies the x, y chromaticity coordinates of the source primaries.
  342.  
  343.   Code   Meaning
  344.   ----   -------
  345.   1      ITU-R Rec. 709 (1990)
  346.   2      unspecified
  347.   4      ITU-R Rec. 624-4 System M
  348.   5      ITU-R Rec. 624-4 System B, G
  349.   6      SMPTE 170M
  350.   7      SMPTE 240M (1987)
  351.  
  352.  /* transfer_characteristics */
  353.  
  354.   Specifies the opto-electronic transfer characteristic of the source picture.
  355.  
  356.   Code   Meaning
  357.   ----   -------
  358.   1      ITU-R Rec. 709 (1990)
  359.   2      unspecified
  360.   4      ITU-R Rec. 624-4 System M
  361.   5      ITU-R Rec. 624-4 System B, G
  362.   6      SMPTE 170M
  363.   7      SMPTE 240M (1987)
  364.   8      linear transfer characteristics
  365.  
  366.  /* matrix_coefficients */
  367.  
  368.   Specifies the matrix coefficients used in deriving luminance and chrominance
  369.   signals from the green, blue, and red primaries.
  370.  
  371.   Code   Meaning
  372.   ----   -------
  373.   1      ITU-R Rec. 709 (1990)
  374.   2      unspecified
  375.   4      FCC
  376.   5      ITU-R Rec. 624-4 System B, G
  377.   6      SMPTE 170M
  378.   7      SMPTE 240M (1987)
  379.  
  380.  
  381.  /* display_horizontal_size */
  382.  
  383.  /* display_vertical_size */
  384.  
  385.   Display_horizontal_size and display_vertical_size specify the "intended
  386.   display's" active region (which may be smaller or larger than the
  387.   encoded frame size).
  388.  
  389.  /* intra_dc_precision */
  390.  
  391.   Specifies the effective precision of the DC coefficient in MPEG-2 
  392.   intra coded macroblocks. 10-bits usually achieves quality saturation.
  393.  
  394.   Code    Meaning
  395.   ----    -----------------
  396.   0       8 bit
  397.   1       9 bit
  398.   2       10 bit
  399.   3       11 bit
  400.  
  401.  /* top_field_first */
  402.  
  403.   Specifies which of the two fields of an interlaced frame comes earlier.
  404.   The top field corresponds to what is often called the "odd field," and 
  405.   the bottom field is also sometimes called the "even field."   
  406.  
  407.   Code  Meaning
  408.   ----  -----------------
  409.   0     bottom field first
  410.   1     top field first
  411.  
  412.  /* frame_pred_frame_dct (I P B) */
  413.  
  414.   Setting this parameter to 1 restricts motion compensation to frame 
  415.   prediction and DCT to frame DCT. You have to specify this separately for 
  416.   I, P and B picture types.
  417.  
  418.  /* concealment_motion_vectors (I P B) */
  419.  
  420.   Setting these three flags informs encoder whether or not to generate 
  421.   concealment motion vectors for intra coded macroblocks in the 
  422.   three respective coded picture types.  This feature is mostly useful
  423.   in Intra-coded pictures, but may also be used in low-delay applications
  424.   (which attempts to exclusively use P pictures for video signal refresh, 
  425.   saving the time it takes to download a coded Intra picture across a 
  426.   channel). concealment_motion_vectors in B pictures are rather pointless 
  427.   since there is no error propagation from B pictures. This feature is 
  428.   currently not implemented.  Please leave values at zero.
  429.  
  430.  /* q_scale_type (I P B) */
  431.  
  432.   These flag sets linear (0) or non-linear (1) quantization scale type 
  433.   for the three respective picture types.
  434.  
  435.  /* intra_vlc_format (I P B) */
  436.  
  437.   Selects one of the two variable length coding tables for intra coded blocks.
  438.   Table 1 is considered to be statistically optimized for Intra coded 
  439.   pictures coded within the sweet spot range (e.g. 0.3 to 0.6 bit/pixel)
  440.   of MPEG-2.
  441.  
  442.   Code  Meaning
  443.   ----  -----------------
  444.   0     table 0 (= MPEG-1) 
  445.   1     table 1
  446.  
  447.  /* alternate_scan (I P B) */
  448.  
  449.   Selects one of two entropy scanning patterns defining the order in 
  450.   which quantized DCT coefficients are run-length coded.  The alternate 
  451.   scanning pattern is considered to be better suited for interlaced video 
  452.   where the encoder does not employ sophisticated forward quantization 
  453.   (as is the case in our current encoder).
  454.  
  455.   Code  Meaning
  456.   ----  -----------------
  457.   0     Zig-Zag scan (= MPEG-1)
  458.   1     Alternate scan 
  459.  
  460.  /* repeat_first_field */
  461.  
  462.   If set to one, the first field of a frame is repeated after the second by
  463.   the display process. The exact function depends on progressive_sequence
  464.   and top_field_first.  repeat_first_field is mainly intended to serve as 
  465.   a signal for the Decoder's Display Process to perform 3:2 pulldown.
  466.  
  467.  /* progressive_frame */
  468.  
  469.   Specifies whether the frames are interlaced (0) or progressive (1).
  470.   MPEG-2 permits mixing of interlaced and progressive video. The encoder
  471.   currently only supports either interlaced or progressive video.
  472.   progressive_frame is therefore constant for all frames and usually
  473.   set identical to progressive_sequence.
  474.  
  475.  /* intra_slice refresh picture period (P factor) */
  476.  
  477.    This value indicates the number of successive P pictures in which  
  478.    all slices (macroblock rows in our encoder model) are refreshed 
  479.    with intra coded macroblocks.  This feature assists low delay mode
  480.    coding.  It is currently not implemented.
  481.  
  482.  /* rate control: r (reaction parameter) */
  483.  /* rate control: avg_act (initial average activity) */
  484.  /* rate control: Xi (initial I frame global complexity measure) */
  485.  /* rate control: Xp (initial P frame global complexity measure) */
  486.  /* rate control: Xb (initial B frame global complexity measure) */
  487.  /* rate control: d0i (initial I frame virtual buffer fullness) */
  488.  /* rate control: d0p (initial P frame virtual buffer fullness) */
  489.  /* rate control: d0b (initial B frame virtual buffer fullness) */
  490.  
  491.   These parameters modify the behavior of the rate control scheme. Usually
  492.   set them to 0, in which case default values are computed by the encoder.
  493.  
  494.  /* P:  forw_hor_f_code forw_vert_f_code search_width/height */
  495.  /* B1: forw_hor_f_code forw_vert_f_code search_width/height */
  496.  /* B1: back_hor_f_code back_vert_f_code search_width/height */
  497.  /* B2: forw_hor_f_code forw_vert_f_code search_width/height */
  498.  /* B2: back_hor_f_code back_vert_f_code search_width/height */
  499.  
  500.   This set of parameters specifies the maximum length of the motion
  501.   vectors. If this length is set smaller than the actual movement
  502.   of objects in the picture, motion compensation becomes ineffective
  503.   and picture quality drops. If it is set too large, an excessive
  504.   number of bits is allocated for motion vector transmission, indirectly
  505.   reducing picture quality, too.
  506.  
  507.   All f_code values have to be in the range 1 to 9 (1 to 7 for MPEG-1),
  508.   which translate into maximum motion vector lengths as follows:
  509.  
  510.   code  range (inclusive)  max search width/height
  511.   ================================================
  512.   1        -8 ...    +7.5       7
  513.   2       -16 ...   +15.5      15
  514.   3       -32 ...   +31.5      31
  515.   4       -64 ...   +63.5      63
  516.   5      -128 ...  +127.5     127
  517.   6      -256 ...  +255.5     255
  518.   7      -512 ...  +511.5     511
  519.   8     -1024 ... +1023.5    1023
  520.   9     -2048 ... +2047.5    2047
  521.  
  522.   f_code is specified individually for each picture type (P,Bn), direction
  523.   (forward prediction, backward prediction) and component (horizontal,
  524.   vertical). Bn is the n'th B frame surrounded by I or P frames
  525.   (e.g.: I B1 B2 B3 P B1 B2 B3 P ...).
  526.  
  527.   For MPEG-1 sequences, horizontal and vertical f_code have to be
  528.   identical and the range is restricted to 1...7.
  529.  
  530.   P frame values have to be specified if N (N = # of frames in GOP) is
  531.   greater than 1 (otherwise the sequences contains only I frames).
  532.  
  533.   M - 1 (M = distance between I/P frames) sets (two lines each) of values
  534.   have to specified for B frames. The first line of each set defines
  535.   values for forward prediction (i.e. from a past frame), the second
  536.   line those for backward prediction (from a future frame).
  537.  
  538.   search_width and search_height set the (half) width of the window used
  539.   for motion estimation. The encoder currently employs exhaustive
  540.   integer vector block matching. Execution time for this algorithm depends
  541.   on the product of search_width and search_height and, too a large extent,
  542.   determines the speed of the encoder. Therefore these values have to be
  543.   chosen carefully.
  544.  
  545.   Here is an example of how to set these values, assuming a maximum
  546.   motion of 10 pels per frame in horizontal and 5 pels per frame in
  547.   vertical direction and M=3 (I B1 B2 P):
  548.  
  549.   search width / height:
  550.  
  551.   forward  hor.  vert.     backward  hor.  vert.
  552.   I -> B1  10     5        B1 <- P   20    10
  553.   I -> B2  20    10        B2 <- P   10     5
  554.   I -> P   30    15
  555.  
  556.   f_code values are then selected as the smallest ones resulting in a range
  557.   larger than the search widths / heights:
  558.  
  559.   3 2  30 15 /* P:  forw_hor_f_code forw_vert_f_code search_width/height */
  560.   2 1  10  5 /* B1: forw_hor_f_code forw_vert_f_code search_width/height */
  561.   3 2  20 10 /* B1: back_hor_f_code back_vert_f_code search_width/height */
  562.   3 2  20 10 /* B2: forw_hor_f_code forw_vert_f_code search_width/height */
  563.   2 1  10  5 /* B2: back_hor_f_code back_vert_f_code search_width/height */
  564.  
  565.  
  566. 4. Interpreting the status information 
  567. ======================================
  568.  
  569.  4.1 Description of the macroblock_type map
  570.  
  571.   The status information routine prints a two-character code for 
  572.   each macroblock in the picture currently being coded:
  573.  
  574.   First character:
  575.  
  576.  S: skipped
  577.  I: intra coded
  578.  0: forward prediction without motion compensation
  579.  F: forward frame/16x8 prediction (in frame/field pictures resp.)
  580.  f: forward field prediction
  581.  p: dual prime prediction
  582.  B: backward frame/16x8 prediction
  583.  b: backward field prediction
  584.  D: frame/16x8 interpolation
  585.  d: field interpolation
  586.  
  587.  Second character:
  588.  
  589.  space: coded, no quantization change
  590.  Q:     coded, quantization change
  591.  N:     not coded (only predicted)
  592.  
  593.  4.2 Description of the mquant map
  594.  
  595.   The mquant map displays the dynamically changing quantization
  596.   parameter as determined by the rate control algorithm. Larger
  597.   values correspond to coarser quantization. Not displayed values
  598.   indicate same quantization as in the previous macroblock.
  599.  
  600.   Note that for for MPEG-1 sequences the displayed values are twice
  601.   as large as the quant_scale parameter defined in ISO 11172-2.
  602.  
  603. 5. Encoder model
  604. ================
  605.  
  606.   The encoder model describes the "algorithm" or "intelligence" of the 
  607.   encoder.
  608.  
  609.  5.1 Motion estimation
  610.  
  611.   Exhaustive search pattern with L1 (Minimum Absolute Difference) matching
  612.   criteria on the original (non-coded) reference frame.  Performed only
  613.   on luminance samples.  Half pel search is done on a neighborhood of 8
  614.   bi-linearly interpolated luminance samples from the reconstructed 
  615.   reference frame.
  616.  
  617.  5.2 Rate control and adaptive quantization
  618.  
  619.   The encoder adheres to a single-pass coding philosophy (no a priori
  620.   measurements guide the allocation of bits at the global layers).
  621.   Target bit allocation for the current picture being encoded is based
  622.   on global bit budget for the Group of Pictures (dependently coded
  623.   sequence of pictures), and a ratio of weighted relative coding
  624.   complexities of the three picture types.  Coding complexity (X) is
  625.   estimated as a picture's product of: average macroblock quantization
  626.   step size (Q) and the number of bits (S) generated by coding the picture
  627.   (e.g.   X = Q*S).
  628.  
  629.   Local bit allocation is based on two measurements: 
  630.   1. deviancy from estimated buffer fullness for the Nth macroblock
  631.   2. normalized spatial activity
  632.  
  633.   The picture is approximated and estimated to have a uniform distribution 
  634.   of bits. If the local trend of generated bits begin to stray from this 
  635.   estimation, a compensation factor emerges to modulate the macroblock 
  636.   quantization scale (mquant). The compensation factor is the difference 
  637.   between where the buffer fullness was predicted at the Nth macroblock 
  638.   and where the buffer fullness truly is) 
  639.  
  640.  
  641.   Local spatial activity is estimated as the minimum variance of the 
  642.   four luminance 8x8 frame blocks and the corresponding four luminance 8x8
  643.   field blocks of the original picture being coded.  The variance measure
  644.   is then normalized against the average variance of the most recently coded
  645.   picture.  The scaled product of the local activity measure and the buffer
  646.   compensation factor are combined to modify the final mquant value which
  647.   will be used in the quantization stage of the subsequent block coding
  648.   processes.
  649.  
  650.  5.3 Decision
  651.  
  652.   The macroblock decision process selects the various prediction
  653.   switches (yes/no coding of prediction error, yes/no motion 
  654.   compensation) which provide the best quality for the relative coding 
  655.   bit cost.  The decision process follows the piecewise path of least 
  656.   distortion, approximating that the decision stages (whether to use 
  657.   forwards, backwards compensation or none at all..., etc.) are mostly 
  658.   uncorrelated (i.e. can be independently decided).
  659.  
  660.  5.4 Macroblock coding
  661.  
  662.   The forward DCT is based on the fast Chen-Wang 1984 algorithm.
  663.  
  664.   Quantization is a mirror of the normative inverse quantizer, as
  665.   specified in the MPEG-2 Test Model.  No special dithering or
  666.   entropy-constrained methods are currently employed.
  667.  
  668.  
  669. 6. References
  670. =============
  671.  
  672. [1] ISO/IEC 13818 Draft International Standard: Generic Coding of
  673.     Moving Pictures and Associated Audio, Part 2: video
  674.  
  675.  
  676. [2] Test Model 5, ISO/IEC JTC1/SC29/WG11/ N0400, MPEG93/457, April 1993.
  677.  
  678. [3] The Graphics Interchange Format(c) is the Copyright property of
  679.     CompuServe Incorporated. GIF(sm) is a Service Mark property of
  680.     CompuServe Incorporated."